<template>
	<view class="content">
		<u-cell-group>
			<u-cell size="large" title="头像">

			</u-cell>
			<u-cell size="large" title="昵称">

			</u-cell>
			<u-cell size="large" title="服务条款">


			</u-cell>
			<u-cell size="large" title="隐私政策">


			</u-cell>

			<u-cell size="large" title="当前版本" value="1.0.0" />

			<view style="width: 80%;margin: auto; margin-top: 40rpx;" v-if="showExit">
				<u-button type="error" text="退出团队" @click="exitTeamHandel"></u-button>
			</view>


			<view style="width: 80%;margin: auto; margin-top: 40rpx;">
				<u-button type="error" text="退出登录" @click="quitHandel"></u-button>
			</view>




		</u-cell-group>
	</view>
</template>

<script>
import { removeToken } from '@/utils/auth'
import { exitTeam } from '@/api/api';
export default {
	data() {
		return {
			showExit: true,
		};
	},
	onShow() {
		if (uni.getStorageSync("TEAMINFO") !== '') this.showExit = true
		else this.showExit = false
	},
	methods: {
		quitHandel() {
			removeToken()
			uni.switchTab({
				url: '/pages/index/index'/*  */
			})
		},
		exitTeamHandel() {
			exitTeam().then(res => {
				uni.removeStorageSync("TEAMINFO")
				uni.removeStorageSync("ISTEAM")
				uni.switchTab({
					url: '/pages/index/index'/*  */
				})
			})
		},
	},
}
</script>

<style lang="scss"></style>
